﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<cludg.Web.ViewModels.StoryDetailsModel>" %>

<%
	bool canRate = (bool)Model["CanUserRate"];
%>

<div class="storyrate">
	Рейтинг: 
	<% if (canRate)
	{%>
		<% if ((int)Model["CurrentUserRate"] < 0)
		{%>
			<span class="storyratenegative active">не нра</span>
		<%
		}
		else
		{%>
			<span class="storyratenegative">
				<%: Html.ActionLink("не нра", "Rate", "Rate", new { StoryId = Model.Story.Id, Positive = false }, null)%>
			</span>
		<%
		} %>
	<%} %>
	<span class="storyratenegativevalue"> -<%: Model["NegativeRate"] %> </span>
	<span class="storyratepositivevalue"> +<%: Model["PositiveRate"] %> </span>
	<% if (canRate)
	{%>
		<% if ((int)Model["CurrentUserRate"] > 0)
		{%>
			<span class="storyratepositive active">нра:)</span>
		<%
		}
		else
		{%>
			<span class="storyratepositive">
				<%: Html.ActionLink("нра:)", "Rate", "Rate", new { StoryId = Model.Story.Id, Positive = true }, null)%>
			</span>
		<%
		} %>
	<%} %>
</div>